package com.shirley.dbExample.service.impl;

import com.shirley.dbExample.entity.SubCompany;
import com.shirley.dbExample.repository.SubCompanyRepository;
import com.shirley.dbExample.service.SubCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SubCompanyServiceImpl extends CrudServiceImpl<SubCompany, Integer> implements SubCompanyService {
    private SubCompanyRepository subCompanyRepository;

    @Autowired
    public SubCompanyServiceImpl(JpaRepository<SubCompany, Integer> subCompanyRepository) {
        super(subCompanyRepository);
        this.subCompanyRepository = (SubCompanyRepository) subCompanyRepository;
    }

    @Override
    public List<SubCompany> findAll() {
        return subCompanyRepository.findAll();
    }
}
